import initAjax from '../../../axios/index'
let $post = initAjax('post');

export default{
    state:{
        Warehouse:[],
        Cargoposition:[]
    },
    getters: {
        Warehouse:state => state.Warehouse,
        Cargoposition:state => state.Cargoposition
    },
    mutations: {
        SET_WAREHOUSE(state,data){
            state.Warehouse = data
        },
        SET_CARGOPOSITION(state,data){
            state.Cargoposition = data
        }
    },
    actions: {
        async getWarehouse({commit,state}){
           
            const data = await $post({
                api:'/show/store/area'
            })
           commit('SET_WAREHOUSE',data);
          
        },
        async getCargoposition({commit,state},params){
            const data = await $post({
                api:'/show/store/areainfo',
                data:{
                    storeId:params
                }
            })
            commit('SET_CARGOPOSITION',data)
        }
    }
    
}